<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>gluon.fileutils</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="gluon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="gluon-module.html">Package&nbsp;gluon</a> ::
        Module&nbsp;fileutils
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="gluon.fileutils-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module fileutils</h1><p class="nomargin-top"><span class="codelink"><a href="gluon.fileutils-pysrc.html">source&nbsp;code</a></span></p>
<p>This file is part of web2py Web Framework (Copyrighted, 2007) 
  Developed by Massimo Di Pierro &lt;mdipierro@cs.depaul.edu&gt; License: 
  GPL v2</p>

<!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="gluon.fileutils-module.html#listdir" class="summary-sig-name">listdir</a>(<span class="summary-sig-arg">path</span>,
        <span class="summary-sig-arg">expression</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">^.+$</code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">drop</span>=<span class="summary-sig-default">True</span>,
        <span class="summary-sig-arg">add_dirs</span>=<span class="summary-sig-default">False</span>)</span><br />
      like os.listdir() but you can specify a regex patter to filter filed.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#listdir">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="gluon.fileutils-module.html#cleanpath" class="summary-sig-name">cleanpath</a>(<span class="summary-sig-arg">path</span>)</span><br />
      turns any expression/path into a valid filename.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#cleanpath">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="_extractall"></a><span class="summary-sig-name">_extractall</span>(<span class="summary-sig-arg">filename</span>,
        <span class="summary-sig-arg">path</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">.</code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">members</span>=<span class="summary-sig-default">None</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#_extractall">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="tar"></a><span class="summary-sig-name">tar</span>(<span class="summary-sig-arg">file</span>,
        <span class="summary-sig-arg">dir</span>,
        <span class="summary-sig-arg">expression</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">^.+$</code><code class="variable-quote">'</code></span>)</span><br />
      tars dir into file, only tars file that match expression</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#tar">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="untar"></a><span class="summary-sig-name">untar</span>(<span class="summary-sig-arg">file</span>,
        <span class="summary-sig-arg">dir</span>)</span><br />
      untar file into dir</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#untar">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="gluon.fileutils-module.html#tar_compiled" class="summary-sig-name">tar_compiled</a>(<span class="summary-sig-arg">file</span>,
        <span class="summary-sig-arg">dir</span>,
        <span class="summary-sig-arg">expression</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">^.+$</code><code class="variable-quote">'</code></span>)</span><br />
      used to tar a compiled application.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#tar_compiled">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="up"></a><span class="summary-sig-name">up</span>(<span class="summary-sig-arg">path</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#up">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_session"></a><span class="summary-sig-name">get_session</span>(<span class="summary-sig-arg">request</span>,
        <span class="summary-sig-arg">other_application</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">admin</code><code class="variable-quote">'</code></span>)</span><br />
      checks that user is authorized to access other_application</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#get_session">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="check_credentials"></a><span class="summary-sig-name">check_credentials</span>(<span class="summary-sig-arg">request</span>,
        <span class="summary-sig-arg">other_application</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">admin</code><code class="variable-quote">'</code></span>)</span><br />
      checks that user is authorized to access other_application</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#check_credentials">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="fix_newlines"></a><span class="summary-sig-name">fix_newlines</span>(<span class="summary-sig-arg">path</span>)</span></td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#fix_newlines">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr class="private">
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="copystream"></a><span class="summary-sig-name">copystream</span>(<span class="summary-sig-arg">src</span>,
        <span class="summary-sig-arg">dest</span>,
        <span class="summary-sig-arg">size</span>,
        <span class="summary-sig-arg">chunk_size</span>=<span class="summary-sig-default">100000</span>)</span><br />
      this is here because I think there is a bug in shutil.copyfileobj</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="gluon.fileutils-pysrc.html#copystream">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="listdir"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">listdir</span>(<span class="sig-arg">path</span>,
        <span class="sig-arg">expression</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">^.+$</code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">drop</span>=<span class="sig-default">True</span>,
        <span class="sig-arg">add_dirs</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="gluon.fileutils-pysrc.html#listdir">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>like os.listdir() but you can specify a regex patter to filter filed. 
  if add_dirs==True the returned items will have the full path.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="cleanpath"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">cleanpath</span>(<span class="sig-arg">path</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="gluon.fileutils-pysrc.html#cleanpath">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>turns any expression/path into a valid filename. replaces / with _ and
  removes special characters.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<a name="tar_compiled"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">tar_compiled</span>(<span class="sig-arg">file</span>,
        <span class="sig-arg">dir</span>,
        <span class="sig-arg">expression</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">^.+$</code><code class="variable-quote">'</code></span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="gluon.fileutils-pysrc.html#tar_compiled">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>used to tar a compiled application. the content of models, views, 
  controllers is not stored in the tar file.</p>
  <dl class="fields">
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="gluon-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://www.web2py.com">web2py Web Framework</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Tue Feb 17 09:15:29 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
